package Aaaaaa;

public class Main14 {
    public static void main(String[] args) {
        System.out.println(new Main14().camelCase("hello word"));
        String a=new String("cd")+new String("sc");
        String b=new String("cd").intern();
        System.out.println(b=="cd");

    }
    public String camelCase(String newString) {
        // write code here
        StringBuilder res = new StringBuilder();
        //遍历字符串
        for (int i = 0; i < newString.length(); i++) {
            //当前字符是数字
            if (Character.isDigit(newString.charAt(i))) {
                res.append(newString.charAt(i));
            } else if (Character.isLetter(newString.charAt(i))) {//当前字符是字母
                res.append((newString.charAt(i) + "").toLowerCase());
            } else {//当前字符是其他字符
                while (i < newString.length() - 1) {//while循环排除当前字符之后所有其他字符
                    i = i + 1;
                    if (Character.isDigit(newString.charAt(i))) {//是数字
                        res.append(newString.charAt(i));//直接拼接
                        break;
                    } else if (Character.isLetter(newString.charAt(i))) {//是字母
                        res.append((newString.charAt(i) + "").toUpperCase());//转化为大写之后拼接
                        break;
                    }
                }
            }
        }
        String str = (res.charAt(0) + "").toLowerCase() + res.toString().substring(1, res.length());//将首字母转化为小写字母
        return str;
    }


}
